/** 客户管理路由 */
import Layout from '@/views/layout/customerLayout'

const customerRouter = {
  path: '/crm',
  component: Layout,
  redirect: '/crm/workbench',
  name: 'crm',
  hidden: true,
  meta: {
    requiresAuth: true,
    title: '客户管理',
    index: 0,
    type: 'crm'
  },
  children: [
    {
      path: 'workbench', // 工作台
      component: () => import('@/views/customermanagement/workbench/workbench'),
      meta: {
        requiresAuth: false,
        title: '仪表盘',
        icon: 'dashboard'
      }
    },
    {
      path: 'message', // 待办事项
      component: () => import('@/views/customermanagement/message/Message'),
      meta: {
        requiresAuth: false,
        title: '待办事项',
        icon: 'message',
        num: 0
      }
    },
    {
      path: 'seas', // 公海列表
      component: () => import('@/views/customermanagement/seas/SeasIndex'),
      meta: {
        requiresAuth: true,
        title: '公海',
        icon: 'seas',
        index: 2,
        type: 'crm',
        subType: ['customer', 'pool']
      }
    },
    {
      path: 'customer', // 客户列表
      component: () => import('@/views/customermanagement/customer/CustomerIndex'),
      meta: {
        requiresAuth: true,
        title: '私库',
        icon: 'customer',
        index: 1,
        type: 'crm',
        subType: 'customer'
      }
    },
    
    {
      path: 'ideacustomer', // 意向客户库
      component: () => import('@/views/customermanagement/ideacustomer/CustomerIndex'),
      meta: {
        requiresAuth: true,
        title: '意向客户库',
        icon: 'leads',
        index: 1,
        type: 'crm',
        subType: 'ideacustomer'
      }
    },
    {
      path: 'okcustomer', // 客户列表
      component: () => import('@/views/customermanagement/okCustomer/OkCustomerIndex'),
      meta: {
        requiresAuth: true,
        title: '成交客户',
        icon: 'business-customer',
        index: 1,
        type: 'crm',
        subType: 'okcustomer'
      }
    },
    {
      path: 'contacts', // 联系人列表
      component: () => import('@/views/customermanagement/contacts/ContactsIndex'),
      meta: {
        requiresAuth: true,
        title: '联系人',
        icon: 'contacts',
        index: 1,
        type: 'crm',
        subType: 'contacts'
      }
    },
    {
      path: 'contract', // 订单列表
      component: () => import('@/views/customermanagement/contract/ContractIndex'),
      meta: {
        requiresAuth: true,
        title: '订单',
        icon: 'contract',
        index: 1,
        type: 'crm',
        subType: 'contract'
      }
    },
    {
      path: 'money', // 回款列表
      component: () => import('@/views/customermanagement/money/MoneyIndex'),
      meta: {
        requiresAuth: true,
        title: '回款',
        icon: 'money',
        index: 1,
        type: 'crm',
        subType: 'receivables'
      }
    },
    // {
    //   path: 'clue', // 线索列表
    //   component: () => import('@/views/customermanagement/clue/ClueIndex'),
    //   meta: {
    //     requiresAuth: true,
    //     title: '线索',
    //     icon: 'leads',
    //     index: 1,
    //     type: 'crm',
    //     subType: 'leads'
    //   }
    // },
    {
      path: 'business', // 商机列表
      name: 'business',
      component: () => import('@/views/customermanagement/business/BusinessIndex'),
      meta: {
        requiresAuth: true,
        title: '商机',
        icon: 'business',
        index: 1,
        type: 'crm',
        subType: 'business'
      }
    },
    {
      path: 'product', // 产品列表
      component: () => import('@/views/customermanagement/product/ProductIndex'),
      meta: {
        requiresAuth: true,
        title: '产品',
        icon: 'product',
        index: 1,
        type: 'crm',
        subType: 'product'
      }
    },
    {
      path: 'confirmation', // 确认函
      component: () => import('@/views/customermanagement/confirmation/confirmationIndex'),
      meta: {
        requiresAuth: true,
        title: '确认函',
        icon: 'certificate',
        index: 1,
        type: 'crm',
        subType: 'confirmation'
      }
    },
    {
      path: 'wo', // 工单库
      component: () => import('@/views/customermanagement/wo/index'),
      meta: {
        requiresAuth: true,
        title: '工单库',
        icon: 'task',
        index: 1,
        type: 'crm',
        subType: 'wo'
      }
    },
    {
      path: 'complete', // 完结库
      component: () => import('@/views/customermanagement/complete/index'),
      meta: {
        requiresAuth: true,
        title: '完结库',
        icon: 'over',
        index: 1,
        type: 'crm',
        subType: 'complete'
      }
    },
    {
        path: 'accounting', // 记账
        component: () => import('@/views/customermanagement/accounting/index'),
        meta: {
          requiresAuth: true,
          title: '记账板块',
          icon: 'moneystatistics',
          index: 1,
          type: 'crm',
          subType: 'accounting'
        }
      },
      {
        path: 'personnel', // 外勤提成
        component: () => import('@/views/customermanagement/personnel/index'),
        meta: {
          requiresAuth: true,
          title: '外勤板块',
          icon: 'goout',
          index: 1,
          type: 'crm',
          subType: 'personnel'
        }
      },
      {
        path: 'finance', // 财务板块
        component: () => import('@/views/customermanagement/finance/index'),
        meta: {
          requiresAuth: true,
          title: '数据中心',
          icon: 'statistics',
          index: 1,
          type: 'crm',
          subType: 'finance'
        }
      },
      {
        path: 'orderstatistics', // 订单统计
        component: () => import('@/views/customermanagement/orderstatistics/index'),
        meta: {
          requiresAuth: true,
          title: '订单统计',
          icon: 'statistics',
          index: 1,
          type: 'crm',
          subType: 'orderstatistics'
        }
      },
      {
        path: 'expence', // 报销板块
        component: () => import('@/views/customermanagement/expence/index'),
        meta: {
          requiresAuth: true,
          title: '批量报销',
          icon: 'pay',
          index: 1,
          type: 'crm',
          subType: 'expence'
        }
      },
      {
        path: 'invoice', // 开票板块
        component: () => import('@/views/customermanagement/invoice/index'),
        meta: {
          requiresAuth: true,
          title: '批量开票',
          icon: 'file',
          index: 1,
          type: 'crm',
          subType: 'invoice'
        }
      },
  ]
}

export default customerRouter
